﻿
/* ****************************************************************************
 *
 * Copyright (c) Mårten Rånge.
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 *
 * ***************************************************************************/

 
using System.Windows;
using System.Windows.Input;
using FolderSize.Common;

// Do not edit this file. It's auto generated. Changes will be overwritten
// If you need to change it change the template file: DependencyProperties.tt

// These classes are intended to extend already existing classes with DependencyProperties 
// DependencyProperties are aweseome to use but a pain to maintain and write
namespace FolderSize.WPF
{
   partial class FolderTree 
   {
   

   partial void OnCanExecuteGoCommandPartial (object parameter, ref bool canExecute);
   
   bool OnCanExecuteGoCommand (object parameter)
   {
      var canExecute = false;
   
      OnCanExecuteGoCommandPartial (parameter, ref canExecute);
   
      return canExecute;
   }

   partial void OnExecuteGoCommandPartial (object parameter);
   
   void OnExecuteGoCommand (object parameter)
   {
      OnExecuteGoCommandPartial (parameter);
   }
   
   void RaiseCanExecuteGoCommandChanged ()
   {
      if (m_cmdGo != null)
      {
         m_cmdGo.RaiseCanExecuteChanged (this);
      }
   }
   
   CustomCommand m_cmdGo;
   
   public ICommand GoCommand
   {
      get
      {
         if (m_cmdGo == null)
         {
            m_cmdGo =
               new CustomCommand (
                  OnCanExecuteGoCommand,
                  OnExecuteGoCommand
               );
         }
         return m_cmdGo;
      }
   }

   partial void OnCanExecuteStopCommandPartial (object parameter, ref bool canExecute);
   
   bool OnCanExecuteStopCommand (object parameter)
   {
      var canExecute = false;
   
      OnCanExecuteStopCommandPartial (parameter, ref canExecute);
   
      return canExecute;
   }

   partial void OnExecuteStopCommandPartial (object parameter);
   
   void OnExecuteStopCommand (object parameter)
   {
      OnExecuteStopCommandPartial (parameter);
   }
   
   void RaiseCanExecuteStopCommandChanged ()
   {
      if (m_cmdStop != null)
      {
         m_cmdStop.RaiseCanExecuteChanged (this);
      }
   }
   
   CustomCommand m_cmdStop;
   
   public ICommand StopCommand
   {
      get
      {
         if (m_cmdStop == null)
         {
            m_cmdStop =
               new CustomCommand (
                  OnCanExecuteStopCommand,
                  OnExecuteStopCommand
               );
         }
         return m_cmdStop;
      }
   }
   
   
      public static readonly DependencyProperty DisplayModeProperty =
         DependencyProperty.Register(
            "DisplayMode",
            typeof (FolderTreeDisplayMode),
            typeof (FolderSize.WPF.FolderTree),
            new PropertyMetadata(
               FolderTreeDisplayMode.Size,
               OnDisplayModePropertyChanged,
               OnDisplayModePropertyCoerceValue)
            );
      
      partial void OnDisplayModePropertyCoerceValuePartial(
         FolderTreeDisplayMode baseValue,
         ref FolderTreeDisplayMode newValue,
         ref bool isProcessed);
         
      static object OnDisplayModePropertyCoerceValue(
         DependencyObject d,
         object baseValue)
      {
         var instance = (FolderSize.WPF.FolderTree)d;
         if (instance != null)
         {
            var bv = (FolderTreeDisplayMode)baseValue;
            var newValue = default(FolderTreeDisplayMode);
            var isProcessed = false;
            instance.OnDisplayModePropertyCoerceValuePartial(
               bv,
               ref newValue,
               ref isProcessed);
            if (isProcessed)
            {
               return newValue;
            }
            else
            {
               return baseValue; 
            }
         }
         else
         {
            return baseValue;
         }
      }

      partial void OnDisplayModePropertyChangedPartial(
         FolderTreeDisplayMode oldValue,
         FolderTreeDisplayMode newValue);
         
      static void OnDisplayModePropertyChanged(
         DependencyObject d,
         DependencyPropertyChangedEventArgs e)
      {
         var instance = (FolderSize.WPF.FolderTree)d;
         var oldValue = (FolderTreeDisplayMode)e.OldValue;
         var newValue = (FolderTreeDisplayMode)e.NewValue;
         if( instance != null )
         {
            instance.OnDisplayModePropertyChangedPartial(
               oldValue,
               newValue);
         }
      }
         
      /// <summary>
      /// Gets and sets DisplayMode(FolderTreeDisplayMode) (this is a DependencyProperty)
      /// </summary>
      public FolderTreeDisplayMode DisplayMode
      {
         get
         {
            return (FolderTreeDisplayMode)GetValue(DisplayModeProperty);
         }
         set
         {
            if( DisplayMode != value )
            { 
               SetValue(
                  DisplayModeProperty,
                  value);
            }
         }
      }

      static readonly DependencyPropertyKey DisplayModesPropertyKey =
         DependencyProperty.RegisterReadOnly(
            "DisplayModes",
            typeof (FolderTreeDisplayMode[]),
            typeof (FolderSize.WPF.FolderTree),
            new PropertyMetadata(
               GetDefaultDisplayModes ()
               ));

      public static DependencyProperty DisplayModesProperty =
         DisplayModesPropertyKey.DependencyProperty;
         
      /// <summary>
      /// Gets DisplayModes(FolderTreeDisplayMode[]) (this is a DependencyProperty)
      /// </summary>
      public FolderTreeDisplayMode[] DisplayModes
      {
         get
         {
            return (FolderTreeDisplayMode[])GetValue(DisplayModesProperty);
         }
         private set
         {
            if( DisplayModes != value )
            { 
               SetValue(
                  DisplayModesPropertyKey,
                  value);
            }
         
         }
      }
         
      public static readonly DependencyProperty JobProperty =
         DependencyProperty.Register(
            "Job",
            typeof (FolderTraverserJob),
            typeof (FolderSize.WPF.FolderTree),
            new PropertyMetadata(
               null,
               OnJobPropertyChanged,
               OnJobPropertyCoerceValue)
            );
      
      partial void OnJobPropertyCoerceValuePartial(
         FolderTraverserJob baseValue,
         ref FolderTraverserJob newValue,
         ref bool isProcessed);
         
      static object OnJobPropertyCoerceValue(
         DependencyObject d,
         object baseValue)
      {
         var instance = (FolderSize.WPF.FolderTree)d;
         if (instance != null)
         {
            var bv = (FolderTraverserJob)baseValue;
            var newValue = default(FolderTraverserJob);
            var isProcessed = false;
            instance.OnJobPropertyCoerceValuePartial(
               bv,
               ref newValue,
               ref isProcessed);
            if (isProcessed)
            {
               return newValue;
            }
            else
            {
               return baseValue; 
            }
         }
         else
         {
            return baseValue;
         }
      }

      partial void OnJobPropertyChangedPartial(
         FolderTraverserJob oldValue,
         FolderTraverserJob newValue);
         
      static void OnJobPropertyChanged(
         DependencyObject d,
         DependencyPropertyChangedEventArgs e)
      {
         var instance = (FolderSize.WPF.FolderTree)d;
         var oldValue = (FolderTraverserJob)e.OldValue;
         var newValue = (FolderTraverserJob)e.NewValue;
         if( instance != null )
         {
            instance.OnJobPropertyChangedPartial(
               oldValue,
               newValue);
         }
      }
         
      /// <summary>
      /// Gets and sets Job(FolderTraverserJob) (this is a DependencyProperty)
      /// </summary>
      public FolderTraverserJob Job
      {
         get
         {
            return (FolderTraverserJob)GetValue(JobProperty);
         }
         set
         {
            if( Job != value )
            { 
               SetValue(
                  JobProperty,
                  value);
            }
         }
      }

      public static readonly DependencyProperty PathProperty =
         DependencyProperty.Register(
            "Path",
            typeof (string),
            typeof (FolderSize.WPF.FolderTree),
            new PropertyMetadata(
               ".",
               OnPathPropertyChanged,
               OnPathPropertyCoerceValue)
            );
      
      partial void OnPathPropertyCoerceValuePartial(
         string baseValue,
         ref string newValue,
         ref bool isProcessed);
         
      static object OnPathPropertyCoerceValue(
         DependencyObject d,
         object baseValue)
      {
         var instance = (FolderSize.WPF.FolderTree)d;
         if (instance != null)
         {
            var bv = (string)baseValue;
            var newValue = default(string);
            var isProcessed = false;
            instance.OnPathPropertyCoerceValuePartial(
               bv,
               ref newValue,
               ref isProcessed);
            if (isProcessed)
            {
               return newValue;
            }
            else
            {
               return baseValue; 
            }
         }
         else
         {
            return baseValue;
         }
      }

      partial void OnPathPropertyChangedPartial(
         string oldValue,
         string newValue);
         
      static void OnPathPropertyChanged(
         DependencyObject d,
         DependencyPropertyChangedEventArgs e)
      {
         var instance = (FolderSize.WPF.FolderTree)d;
         var oldValue = (string)e.OldValue;
         var newValue = (string)e.NewValue;
         if( instance != null )
         {
            instance.OnPathPropertyChangedPartial(
               oldValue,
               newValue);
         }
      }
         
      /// <summary>
      /// Gets and sets Path(string) (this is a DependencyProperty)
      /// </summary>
      public string Path
      {
         get
         {
            return (string)GetValue(PathProperty);
         }
         set
         {
            if( Path != value )
            { 
               SetValue(
                  PathProperty,
                  value);
            }
         }
      }

      static readonly DependencyPropertyKey ProgressInfoPropertyKey =
         DependencyProperty.RegisterReadOnly(
            "ProgressInfo",
            typeof (string),
            typeof (FolderSize.WPF.FolderTree),
            new PropertyMetadata(
               "FolderSize.WPF"
               ));

      public static DependencyProperty ProgressInfoProperty =
         ProgressInfoPropertyKey.DependencyProperty;
         
      /// <summary>
      /// Gets ProgressInfo(string) (this is a DependencyProperty)
      /// </summary>
      public string ProgressInfo
      {
         get
         {
            return (string)GetValue(ProgressInfoProperty);
         }
         private set
         {
            if( ProgressInfo != value )
            { 
               SetValue(
                  ProgressInfoPropertyKey,
                  value);
            }
         
         }
      }
         
   }
}
namespace FolderSize.WPF
{
   partial class BubbleContentControl 
   {
   
   
   
      static readonly DependencyPropertyKey ContentRectPropertyKey =
         DependencyProperty.RegisterReadOnly(
            "ContentRect",
            typeof (Rect),
            typeof (FolderSize.WPF.BubbleContentControl),
            new PropertyMetadata(
               new Rect(0,0,100,100)
               ));

      public static DependencyProperty ContentRectProperty =
         ContentRectPropertyKey.DependencyProperty;
         
      /// <summary>
      /// Gets ContentRect(Rect) (this is a DependencyProperty)
      /// </summary>
      public Rect ContentRect
      {
         get
         {
            return (Rect)GetValue(ContentRectProperty);
         }
         private set
         {
            if( ContentRect != value )
            { 
               SetValue(
                  ContentRectPropertyKey,
                  value);
            }
         
         }
      }
         
      public static readonly DependencyProperty ContentRectMarginProperty =
         DependencyProperty.Register(
            "ContentRectMargin",
            typeof (Thickness),
            typeof (FolderSize.WPF.BubbleContentControl),
            new PropertyMetadata(
               new Thickness(4),
               OnContentRectMarginPropertyChanged,
               OnContentRectMarginPropertyCoerceValue)
            );
      
      partial void OnContentRectMarginPropertyCoerceValuePartial(
         Thickness baseValue,
         ref Thickness newValue,
         ref bool isProcessed);
         
      static object OnContentRectMarginPropertyCoerceValue(
         DependencyObject d,
         object baseValue)
      {
         var instance = (FolderSize.WPF.BubbleContentControl)d;
         if (instance != null)
         {
            var bv = (Thickness)baseValue;
            var newValue = default(Thickness);
            var isProcessed = false;
            instance.OnContentRectMarginPropertyCoerceValuePartial(
               bv,
               ref newValue,
               ref isProcessed);
            if (isProcessed)
            {
               return newValue;
            }
            else
            {
               return baseValue; 
            }
         }
         else
         {
            return baseValue;
         }
      }

      partial void OnContentRectMarginPropertyChangedPartial(
         Thickness oldValue,
         Thickness newValue);
         
      static void OnContentRectMarginPropertyChanged(
         DependencyObject d,
         DependencyPropertyChangedEventArgs e)
      {
         var instance = (FolderSize.WPF.BubbleContentControl)d;
         var oldValue = (Thickness)e.OldValue;
         var newValue = (Thickness)e.NewValue;
         if( instance != null )
         {
            instance.OnContentRectMarginPropertyChangedPartial(
               oldValue,
               newValue);
         }
      }
         
      /// <summary>
      /// Gets and sets ContentRectMargin(Thickness) (this is a DependencyProperty)
      /// </summary>
      public Thickness ContentRectMargin
      {
         get
         {
            return (Thickness)GetValue(ContentRectMarginProperty);
         }
         set
         {
            if( ContentRectMargin != value )
            { 
               SetValue(
                  ContentRectMarginProperty,
                  value);
            }
         }
      }

   }
}
